<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<jsp:include page="/jsp/loginCheck.jsp" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Usuários</title>
	<link href="../css/estiloframes.css" rel="stylesheet" type="text/css" />
	<link href="../css/blue.css" rel="stylesheet" type="text/css" id="" media="print, projection, screen" />
	<script type="text/javascript" src="../js/jquery-latest.js"></script>
	<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
	<script type="text/javascript" src="../js/jquery.tablesorter.pager.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("table").tablesorter({
				headers: {0: {sorter: false}, 3: {sorter: false}},
				widgets: ['zebra']
			}).tablesorterPager({container: $("#pager")});
		}); 

		var checked = false;
		function SetAllCheckBoxes(FormName, FieldName)
		{
		 	if (checked == false) {
		 		CheckValue = true;
			} else {
				CheckValue = false;
			}
			checked = CheckValue;
			
			if(!document.forms[FormName])
				return;
			var objCheckBoxes = document.forms[FormName].elements[FieldName];
			if(!objCheckBoxes)
				return;
			var countCheckBoxes = objCheckBoxes.length;
			if(!countCheckBoxes)
				objCheckBoxes.checked = CheckValue;
			else
				// set the check value for all check boxes
				for(var i = 0; i < countCheckBoxes; i++)
					objCheckBoxes[i].checked = CheckValue;
		}
	</script>
</head>
	
<body>
	<div id="corpo">
		<s:form action="Pesquisas" name="myForm">
		<br />
		<p class="titulo_texto">Manutenção de Pesquisas</p>
		<div style="padding-left:10px;padding-right:10px;">
			<table class="tablesorter" align="center" width="620" border="0" cellpadding="4" cellspacing="4" id="example">
		 		<thead>
					<tr class="header" align="center">
						<th width="20"><input type='checkbox' name='checkall' onclick="SetAllCheckBoxes('myForm', 'pesquisasCkb');"/></th>
						<th width="300"><s:text name="Pesquisas"/></th>
						<th width="200"><s:text name="Data de Inclusão"/></th>
						<th width="100">&nbsp;</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="pesquisas" status="pesquisasStatus"> 
						<tr>
							<td><s:checkbox name="pesquisasCkb" fieldValue="%{id}"/></td>
							<td><s:property value="nome"/></td>	
							<td><s:property value="dataCriacao"/></td>
							<td>
								<a href="<s:url action='editPesquisas'><s:param name="pesquisa.id" value="%{id}"/></s:url>" ><img src="../images/btn/editar.png" alt="Editar" style="cursor:pointer;" border="0"/></a>
								<a href="<s:url action='confirmDataPesquisas'><s:param name="pesquisa.id" value="%{id}"/></s:url>" ><img src="../images/btn/excluir.png" alt="Excluir" style="cursor:pointer;" border="0"/></a>
							</td>					
						</tr>
					</s:iterator> 				
				</tbody>
		  </table>
		  <table align="center" width="400" border="0">
			  <tr>
				  <td align="left"><s:submit action="novaPesquisa" type="image" src="../images/btn/adicionarpesquisa.png" cssClass="clicavel" align="center"/><s:text name="Adicionar Pesquisas"/></td>
				  <td align="left"><s:submit action="deleteAllPesquisas" type="image" src="../images/btn/excluir.png" cssClass="clicavel" align="center"/><s:text name="Excluir Selecionados"/></td>
			  </tr>
		  </table>		  
		  <div id="pager" class="pager">
				<form>
					<img src="../images/icons/first.png" class="first"/>
					<img src="../images/icons/prev.png" class="prev"/>
					<input type="text" class="pagedisplay" disabled="disabled"/>
					<img src="../images/icons/next.png" class="next"/>
					<img src="../images/icons/last.png" class="last"/>
					<select class="pagesize" disabled="true">
						<option selected="selected"  value="5">5</option>																				
					</select>					
				</form>
			</div>
	  </div>
 
	</s:form>
	</div>
	</body>
</html>
